<template>
    <div class="buyMoreList">
        <h2>你还可以兑换</h2>

        <ul>
            <li class="exchange-item" v-for="item in listData" :key="item.id" @click="toDetailPage(item.id)">
                <img :src=" imgBaseUrl + item.img" alt="">
                <div class="info">
                    <h3 class="title ellipsis">{{item.name}}</h3>
                    <p class="price"> <span>{{item.coin}}</span> <img src="@/assets/img/monad.png"> </p>
                </div>
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    props:['listData'],
    methods:{
        toDetailPage(id){
            this.$router.push({ path:'/detail', query:{ id }})
        }
    }
}
</script>

<style scoped lang="less">
@import url("../../assets/css/public.less");
    .buyMoreList{
        width: 170px;
        border-left: 1px solid #ececec;
        padding-left: 20px;

        h2{
            font-size: 18px;
            font-family: SourceHanSansSC;
            font-weight: 400;
            color: #333333;
        }

        ul{
            .exchange-item{
                margin-top: 20px;
                display: flex;
                cursor: pointer;

                img{
                    width: 70px;
                    border: 1px solid transparent;
                }
                .info{
                    padding-left: 10px;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    color: #666666;

                    .title{
                        font-size: 14px;
                        font-weight: normal;
                        font-stretch: normal;
                        line-height: 20px;
                        margin-bottom: 5px;
                    }

                    .price{
                        font-family: SourceHanSansSC-Bold;
                        font-size: 18px;
                        font-weight: normal;
                        font-stretch: normal;
                        line-height: 20px;
                        letter-spacing: 0px;
                        display: flex;
                        align-items: center;

                        span{
                            color: #ff5e0f;
                            font-weight: 700;
                        }

                        img{
                            margin-left: 5px;
                            width: 20px;
                            height: 20px;
                            border: 0;
                        }
                        
                    }
                }

                &:hover{
                    img{
                        border: 1px solid @base-color;
                    }

                    .title{
                        color: @base-color;
                    }
                }
            }
        }
        
    }
</style>
